#ifndef  _GLOBAL_H__
#define  _GLOBAL_H__

//使用NDK的log
extern "C" {
#include "libavcodec/avcodec.h"
}

#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,"ERROR: ", __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,"INFO: ", __VA_ARGS__)

enum enPlayState
{
    enPP_NONE,
    enPP_PLAY,
    enPP_PAUSEING,
    enPP_PAUSE
};

enum enMediaType
{
    enMT_NONE,
    enMT_VIDEO,
    enMT_AUDIO
};

struct SVideoInfo
{
    int nW;
    int nH;
    int nBitrate;
    int nFPS;
    AVCodecID cID;
};

struct SAudioInfo
{
    int nResample;
    int nChannels;
    int nChannel_layout;
    AVCodecID cID;
    int nFrameSize;
};

struct SMediaInfo
{
    bool        bEnableVideo;
    bool        bEnableAudio;
    SVideoInfo  tagVInfo;
    SAudioInfo  tagAInfo;
    //总时长
    int64_t     nTimeLen;
};

//设置buffer输出格式，YUV：1， RGB：0
#define BUFFER_FMT_YUV 1
#define USE_SWR_AUDIO 1
#define  MAX_AUDIO_FRAME_SIZE 10240
#endif